<?php
echo phpinfo();exit;
//浏览器缓存304

//获取时间
$since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
//$browserCachedCopyTimestamp = strtotime(preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']));
$lifetime=30;
//var_dump($browserCachedCopyTimestamp);
//var_dump(strtotime($since));
if(strtotime($since)+$lifetime>time()){
    header('HTTP/1.1 304 NOT Modified');exit;
}
//Last-Modified : 通知浏览器资源的最后修改时间
//If-Modified-Since : 得到资源的最后修改时间后，会将这个信息通过If-Modified-Since提交到服务器做检查，如果没有修改返回304状态码
header('Last-Modified:'.gmdate('D d M Y H:i:s',time()).'GMT');
echo time();
exit;
if (strtotime($since) + $lifetime > time()) {
    header('HTTP/1.1 304 Not Modified');
    exit;
}
header('Last-Modified: '.gmdate('D, d M Y H:i:s',time()). ' GMT');
echo date('Y-m-d H:i:s');